import BaseApi from "./BaseApi";
const user = "/park";

export default {

    getPark(condition) {
        let url = "/getParkList";
        return this.requestPost(user, url, condition);
    },

    getParkPoint(condition){
        let url = '/getTruckSpaceListGeo'
        return this.requestPost(user,url,condition)
    },

    exportParkExcel(condition) {
        return this.requestDownloadGet(user, "/parkExcel", condition);
    },

    getTruckSpaceListByParkId(condition) {
        return this.requestPost(user, '/getTruckSpaceListByParkId', condition)
    },
    getChargeInfo(condition) {
        return this.requestPost(user, '/getChargeInfo', condition)
    },
    
    //请求封装
    requestGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestGet(newUrl, condition);
    },
    requestPost(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPost(newUrl, condition);
    },
    requestDownloadGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestDownloadGet(newUrl, condition);
    }
}
